import cv2
index = 0
while True:
    cap = cv2.VideoCapture(index, cv2.CAP_V4L)
    if not cap.isOpened():
        break
    cap.release()
    index += 1
print("Available camera indexes:", list(range(index)))
